<?php
if(!defined('ADMIN')){
    exit('Access Denied');
}
?>

<div class="pageContent">
       <input type="hidden" name="id" id="goodsid" value="<?=$row['id']?>" />
        <input type="hidden" name="sub" value="save" />

        <div class="pageFormContent" layoutH="50">
            <p><label>菜品：</label>
                <?=$row['title']?>
            </p>
            <p><label>备注：</label>
               <textarea rows="5" cols="40" name="remark" id="remark"></textarea>
            </p>


        </div>
        <div class="formBar">
            <ul>
                <li><div class="buttonActive"><div class="buttonContent"><button onclick="addremark()" type="submit">确定</button></div></div></li>

            </ul>
        </div>

</div>

<script>
function addremark()
{
    var id = $('#goodsid').val();
    var remark = $('#remark').val();
    //alert(remark);
    if(id <= 0)
    {
        alert('请选择菜品');
        return false;
    }

    if(remark != '')
    {
        remarkArr[id] = remark;
    }
    else{
        //删除
        remarkArr[id] = '';
    }
    remarkStr = '';
    for(var key in remarkArr)
    {
        if(remarkStr != '')
        {
            remarkStr += "##";
        }
        if(remarkArr[key] != '')
        {
            remarkStr += key+"||"+remarkArr[key];
        }
    }
    $('#orderRemark').val(remarkStr);
    $.pdialog.closeCurrent();
}

$(document).ready(function(){
    var id = $('#goodsid').val();
    if(remarkArr[id] != '')
    {
        $('#remark').val(remarkArr[id]);
    }
})
</script>
